Index
439
in pipelines, 238–247
positional-only arguments,
96–101
multiple return values, 77–80
variable positional arguments,
86–89
from collections.abc module,
174–178
diamond inheritance, 161–162,
207–208
initializing parent classes, 160–164
injecting
functools.wraps method, 101–104
data into generators, 126–131
dependencies, 378–379
mocks, 371–375
G
gc built-in module, 384–386
generator expressions, 121–122
generators, 107
input/output (I/O). See I/O (input/
output)
insertion ordering, dictionaries,
58–65
installing modules, 389–390
integration tests, unit tests versus,
365
interactive debugging, 379–384
interfaces, 145
yield from for composing,
123–126
injecting data into, 126–131
itertools module with, 136–142
returning lists versus, 114–116
send method, 126–131
throw method, 132–136
generic object construction,
155–160
get method for missing dictionary
keys, 65–70
getter methods, attributes versus,
181–185
simple functions for, 151–155
interpolated format strings. See
f-strings
I/O (input/output)
avoiding blocking asyncio event
loop, 289–292
using threads for, 230–235
highly concurrent, 266–271
porting threaded I/O to asyncio
built-in module, 271–282
zero-copy interactions, 346–351
isolating tests, 365–367
iterator protocol, 119–121
iterators. See also loops
combining items, 139–142
filtering items, 138–139
generator expressions and,
121–122
GIL (global interpreter lock), 230–
235, 292
gradual typing, 426
H
hasattr built-in function, 198–199
hash tables, 43
heapq built-in module, 336–346
heaps, 341
helper functions, expressions
versus, 21–24
highly concurrent I/O, 266–271
hooks, functions as, 151–155
generator functions and, 115–116
linking, 136–138
as function arguments, 116–121
StopIteration exception, 117
itertools module, 136–142
itertools.accumulate method,
139–140
itertools.chain method, 136
itertools.combinations method, 141
itertools.combinations_with_
replacement method, 141–142
itertools.cycle method, 137
I
if/else conditional expressions, 23
import paths, stabilizing, 317–319
importing modules, 5, 414–415
in expressions for missing
dictionary keys, 65–70
indexing
slicing and, 44
unpacking versus, 24–28
inheritance